﻿#pragma once


#include "math/bMath.h"

namespace Base {

	class Transform
	{
	public:

		Transform() {
			m_localPosition = Vec3::Zero();
			m_localRotation = Quaternion::Identity();
			m_localScale = Vec3::One();
			m_localDirty = true;
		}

		Matrix4x4& GetLocalMatrix();

		void SetLocalPosition(const Vec3& pos) {
			m_localPosition = pos;
			m_localDirty = true;
		}
		void SetLocalPosition(float x, float y, float z) {
			m_localPosition.Set(x, y, z);
			m_localDirty = true;
		}

		void SetLocalRotation(const Quaternion& rot) {
			m_localRotation = rot;
			m_localDirty = true;
		}
		void SetLocalScale(const Vec3& scale) {
			m_localScale = scale;
			m_localDirty = true;
		}

	public:
		Matrix4x4 m_worldMatrix;

		Vec3 m_localPosition;
		Quaternion m_localRotation;
		Vec3 m_localScale;

		bool m_localDirty = false;
	};

}

